const express = require('express');
const router = express.Router();
const { protect } = require('../middlewares/auth');
const {
  generateLearningPath,
  getLearningPathByDocument,
  getUserLearningPaths,
  getLearningPathById,
  updateStepProgress,
  getNextStep
} = require('../controllers/learningPathController');

// 生成学习路径
router.post('/generate/:documentId', protect, generateLearningPath);

// 获取文档的学习路径
router.get('/document/:documentId', protect, getLearningPathByDocument);

// 获取用户的所有学习路径
router.get('/user', protect, getUserLearningPaths);

// 获取学习路径详情
router.get('/:id', protect, getLearningPathById);

// 更新学习步骤状态
router.put('/:id/progress', protect, updateStepProgress);

// 获取下一个学习步骤
router.get('/:id/next-step', protect, getNextStep);

module.exports = router; 